.class Lcom/baidu/z;
.super Ljava/lang/Thread;


# instance fields
.field final synthetic a:Lcom/baidu/AdView;

.field final synthetic b:Lcom/baidu/AdView;


# direct methods
.method constructor <init>(Lcom/baidu/AdView;Lcom/baidu/AdView;)V
    .locals 0

    iput-object p1, p0, Lcom/baidu/z;->b:Lcom/baidu/AdView;

    iput-object p2, p0, Lcom/baidu/z;->a:Lcom/baidu/AdView;

    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 8

    const/4 v7, 0x1

    invoke-static {}, Landroid/os/Looper;->prepare()V

    :try_start_0
    iget-object v0, p0, Lcom/baidu/z;->b:Lcom/baidu/AdView;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/baidu/c;->a()Lcom/baidu/c;

    move-result-object v2

    invoke-virtual {v2}, Lcom/baidu/c;->g()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "/cpro/ui/mads.php"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/baidu/AdView;->a(Lcom/baidu/AdView;Ljava/lang/String;)V

    const-string v0, "%s?code=%s"

    const/4 v1, 0x2

    new-array v1, v1, [Ljava/lang/Object;

    const/4 v2, 0x0

    const-string v3, "http://mpro.baidu.com/ex/dispatch.html"

    aput-object v3, v1, v2

    const/4 v2, 0x1

    const-string v3, "q=%s&appid=%s"

    const/4 v4, 0x2

    new-array v4, v4, [Ljava/lang/Object;

    const/4 v5, 0x0

    iget-object v6, p0, Lcom/baidu/z;->b:Lcom/baidu/AdView;

    invoke-virtual {v6}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v6}, Lcom/baidu/r;->b(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v4, v5

    const/4 v5, 0x1

    iget-object v6, p0, Lcom/baidu/z;->b:Lcom/baidu/AdView;

    invoke-virtual {v6}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v6}, Lcom/baidu/r;->a(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v6

    aput-object v6, v4, v5

    invoke-static {v3, v4}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/baidu/ax;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    aput-object v3, v1, v2

    invoke-static {v0, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    const-string v1, "dispatcher"

    invoke-static {v1, v0}, Lcom/baidu/bk;->b(Ljava/lang/String;Ljava/lang/String;)I

    iget-object v1, p0, Lcom/baidu/z;->a:Lcom/baidu/AdView;

    invoke-virtual {v1}, Lcom/baidu/AdView;->getContext()Landroid/content/Context;

    move-result-object v1

    const/16 v2, 0x2710

    const/16 v3, 0x2710

    invoke-static {v1, v0, v2, v3}, Lcom/baidu/w;->a(Landroid/content/Context;Ljava/lang/String;II)Ljava/lang/String;

    move-result-object v0

    const-string v1, "dispatcher"

    invoke-static {v1, v0}, Lcom/baidu/bk;->b(Ljava/lang/String;Ljava/lang/String;)I

    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1, v0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    const-string v0, "type"

    invoke-virtual {v1, v0}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v0

    if-gez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    if-ne v0, v7, :cond_1

    iget-object v0, p0, Lcom/baidu/z;->b:Lcom/baidu/AdView;

    const-string v2, "requrl"

    invoke-virtual {v1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/baidu/AdView;->a(Lcom/baidu/AdView;Ljava/lang/String;)V

    iget-object v0, p0, Lcom/baidu/z;->b:Lcom/baidu/AdView;

    sget-object v1, Lcom/baidu/t;->c:Lcom/baidu/t;

    invoke-static {v0, v1}, Lcom/baidu/AdView;->a(Lcom/baidu/AdView;Lcom/baidu/t;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :cond_1
    :goto_1
    iget-object v0, p0, Lcom/baidu/z;->b:Lcom/baidu/AdView;

    invoke-static {v0}, Lcom/baidu/AdView;->e(Lcom/baidu/AdView;)Landroid/os/Handler;

    move-result-object v0

    new-instance v1, Lcom/baidu/aa;

    invoke-direct {v1, p0}, Lcom/baidu/aa;-><init>(Lcom/baidu/z;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-static {v0}, Lcom/baidu/bk;->a(Ljava/lang/Throwable;)I

    goto :goto_1
.end method
